<?php
namespace app\index\controller;

class Index extends Common
{
    public function index()
    {
    	//首页最新文章调用
    	$article=new \app\index\model\Article();
    	$newArt=$article->getnewArt();
    	$sitehot=$article->getsitehot();
    	/*//最新更新分类
    	$newcate=db('cate')->field('id,catename,type')->order('id desc')->limit(7)->select()*/;

    	//友情链接数据
    	$links=db('link')->order('sort asc')->limit(7)->select();

        //获取推荐文章
        $recart=$article->getRecart();

        //获取推荐栏目
        $reccate=db('cate')->field('id,catename,type')->where('rec_index',1)->order('id desc')->limit(5)->select();
    	//dump($newArt);die;
    	$this->assign(array(
    		'newArt'=>$newArt,
    		'sitehot'=>$sitehot,
    		'reccate'=>$reccate,
    		'links'=>$links,
            'recart'=>$recart,
    		));
        return view();
    }
}
